package com.ricky;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;

/**
 * Created by baiguantao on 2017/12/20.
 * 打开当前文件所在目录
 */
public class OpenCurDir extends AnAction {

    @Override
    public void actionPerformed(AnActionEvent e) {
        Project project=e.getData(PlatformDataKeys.PROJECT);
        String curpath=e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY)[0].getPath();//当前文件路径
        FileUtil.openDir(curpath,project);
    }
}
